package com.cleaningcloud.erp.controller;

import com.cleaningcloud.common.core.web.controller.BaseController;
import com.cleaningcloud.common.core.web.domain.AjaxResult;
import com.cleaningcloud.erp.domain.MaterialsBI;
import com.cleaningcloud.erp.service.IMaterialsBIService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className 物资报表BI控制类
 * @description //TODO
 * @author Shaw
 * @date: 2025-03-05 17:07
 * @param: //TODO
 */ 
@RestController
@RequestMapping("/materialsBI")
public class MaterialsBIController extends BaseController {

    //营运报表BI业务接口
    @Autowired
    private IMaterialsBIService MaterialsBIService;

    /**
     * @Author Shaw
     * @Description 合同金额汇总
     * @date: 2025-04-09 12:06
     * @param: //TODO
     */
    @GetMapping("/getMaterialsBIWareAmount")
    public AjaxResult getMaterialsBIWareAmount(MaterialsBI materialsBI) {
        return success(MaterialsBIService.getMaterialsBIWareAmount(materialsBI));
    }

    /**
     * @Author Shaw
     * @Description 根据商品类型获取TO8商品数量/金额（总仓）
     * @date: 2025-04-09 12:06
     * @param: typeVal(1按数量2按金额)
     */
    @GetMapping("/getMaterialsBICommodityTypeNumberByGeneralWare")
    public AjaxResult getMaterialsBICommodityTypeNumberByGeneralWare(MaterialsBI materialsBI) {
        return success(MaterialsBIService.getMaterialsBICommodityTypeNumberByGeneralWare(materialsBI));
    }

    /**
     * @Author Shaw
     * @Description 根据商品类型获取TO8商品数量/金额（项目仓）
     * @date: 2025-04-09 12:06
     * @param: typeVal(1按数量2按金额)
     */
    @GetMapping("/getMaterialsBICommodityTypeNumberByProjectWare")
    public AjaxResult getMaterialsBICommodityTypeNumberByProjectWare(MaterialsBI materialsBI) {
        return success(MaterialsBIService.getMaterialsBICommodityTypeNumberByProjectWare(materialsBI));
    }

    /**
     * @Author Shaw
     * @Description 根据商品类型获取TO8商品数量/金额（个人仓）
     * @date: 2025-04-09 12:06
     * @param: typeVal(1按数量2按金额)
     */
    @GetMapping("/getMaterialsBICommodityTypeNumberByPersonWare")
    public AjaxResult getMaterialsBICommodityTypeNumberByPersonWare(MaterialsBI materialsBI) {
        return success(MaterialsBIService.getMaterialsBICommodityTypeNumberByPersonWare(materialsBI));
    }
}
